<?php

namespace App\Models;

use App\Services\CommonService;
use App\Services\EducationService;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Testing\Fluent\Concerns\Has;

class MemberAlipayRisk extends Model
{
     use HasFactory;
    protected $table = 'sp_member_alipay_risk';
    protected $primaryKey = 'id';
    public $timestamps = false;
    //查询地区信息


    public static function query($uid)
    {
        $res=self::where('uid',$uid)->orderBy('id','desc')->get();
        return obToArray($res);
    }

    public  function insertMember($cert_no,$cert_name,$mobile,$uid,$risk_name,$risk_desc,$result)
    {

       // $res= self::where('cert_no',$cert_no)->value('id');
//        if($res){
//            return ReturnMsg(CommonService::HTTP_CODE_FAIL, '此用户已查询');
//        }
        $data=['cert_no'=>$cert_no,'cert_name'=>$cert_name,'uid'=>$uid,'risk_name'=>$risk_name,'risk_desc'=>$risk_desc,'result'=>$result,'create_time'=>time()];

        return self::insert($data);

    }



}
